<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>horizontal-scroll-snap</title>
    <style>
        .horizontal-snap {
            margin: 0 auto;
            display: grid;
            grid-auto-flow: column;
            gap: 1rem;
            height: calc(180px + 1rem);
            padding: 1rem;
            max-width: 480px;
            overflow-y: auto;
            overscroll-behavior: contain;
            scroll-snap-type: x mandatory;
        }
        .horizontal-snap .link {
            scroll-snap-align: center;
        }
        .horizontal-snap .img {
            width: 180px;
            max-width: none;
            object-fit: contain;
            border-radius: 1rem;
        }
        .horizontal-snap::-webkit-scrollbar {
            display: none;
        }
    </style>
</head>
<body>
    <div class="horizontal-snap">
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/1.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/2.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/3.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/4.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/5.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/6.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/7.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/8.jpg" alt="图片加载中" class="img">
        </a>
        <a href="#" target="_blank" rel="noopener noreferrer" class="link">
            <img src="https://www.eveningwater.com/my-web-projects/js/26/img/9.jpg" alt="图片加载中" class="img">
        </a>
    </div>
</body>
</html>